{%extends "base.html" %}
			
	{% load utils %}

{% block mainbody %}

	<div class="container">
		<div class="row clearfix">
			<div class="col-md-12 column">
				<div class="row clearfix">
					<div class="col-md-8 column">
						<div class="panel panel-default">
							<div class="panel-heading">
								<h3 class="panel-title">
									{{ Article.title }} 

								</h3>
								
	
							</div>
							<div class="panel-body">
								{{ Article.excerpt }}

								{{ Article.content }}
							</div>
							<div class="panel-footer">
								<a href="/userinfo/?username={{ Article.user }}" class="btn btn-link">
									<i class="glyphicon glyphicon-user"></i>
														作者 ({{ Article.user }})
													</a>


   <a href="#" class="btn btn-link">
														<i class=".glyphicon .glyphicon-time"></i>
														发布时间   {{ Article.created_time }}
													</a>


											{% if request_user == Article.user %}

								<a href="{% url 'upArticle' %}?id={{ Article.id }}" class="btn btn-link">
									<i class=".glyphicon .glyphicon-time"></i>
														修改文章   
								</a>

								<a href="{% url 'delArticle' %}?id={{ Article.id }}" onclick="del()" class="btn btn-link">
									<i class=".glyphicon .glyphicon-time"></i>
														删除文章  
								</a>
																			{% endif %}






							</div>
						</div>

					</div>
					<div class="col-md-4 column">
						<div class="list-group">
							<a href="#" class="list-group-item active">{{ Article.Class }}</a>
							{% for a in ArticleClass %}
								<div class="list-group-item">
								<a href="{% url 'showArticle'  %}?id={{ a.id }}" >{{ a }}</a>

								</div>

							{% endfor %}

						</div>
					</div>
				</div>
			</div>

			<div class="col-md-8 column">
				<div class="panel panel-default">

					<div class="panel-heading">
						<h3 class="panel-title">
									共有{{ comment.count }}条评论

								</h3>

					</div>

					<div class="panel-body">
					<ul>
 

						{% for a in comment.comment_list %}
								

																<li>
																<img src="{% get_img a.user %}" class="img-circle" width="30" height="30">  {{ a.user }} ({{ a.created_time }}) <br>       <br> {{ a.content }}  <br>     <br><br>
																{% if a.status  == 'p' %}

																<img src="{% get_img a.replyUser %}" class="img-circle" width="30" height="30">       {{ a.replyUser }} ({{ a.modified_time }})<br>  <br>   {{ a.reply }}   <br>  <br>   <br><br>

																{% else %}
																																{% if request_user == Article.user %}

																<a href="{% url 'comment_put' %}}?id={{ a.id }}&ar_id={{Article.id}}">回复</a>
																			{% endif %}

																{% endif %}


																</li>


							{% endfor %}


						</ul>
					</div>

					
				</div>

			</div>
			<div class="col-md-4 column"></div>
{% if request_user != Article.user %}

              {% if request.user.is_authenticated  %}

			<div class="col-md-8 column">
				<div class="panel panel-default">

					<div class="panel-heading">
						<h3 class="panel-title">
									评论框

								</h3>

					</div>

					<div class="panel-body">

     			 <form class="navbar-form navbar-left" role="search" action="{% url 'comments' %}"   method="post">
        {% csrf_token %}
       
            <input name="id" value="{{ Article.id }}" style="display:none;">

							<div class="wmd-wrapper" id="id_content-wmd-wrapper">
								<textarea cols="40" id="id_content" name="content" rows="10" required=""></textarea>
							</div>


							<button type="submit" class="btn btn-default">提交评论</button>
						</form>

					</div>

					
				</div>

			</div>
			              {%  endif %}

			{% endif %}

			<div class="col-md-4 column"></div>






		</div>
	</div>
<script>
function del(){

	alert("确认删除这扁文章")
}
</script>
{% endblock %}